package com.bree.erp.service;

import java.util.Collection;

import com.bree.erp.entity.PrefixSequence;
import com.bree.erp.entity.Project;
import com.bree.erp.entity.PurchaseRequisition;
import com.bree.erp.entity.Status;
import com.bree.erp.entity.User;

public interface PurchaseRequisitionService extends Crud<PurchaseRequisition, Long>{

	PurchaseRequisition create(User user, Project project, String description);
	PurchaseRequisition update(Long id, Project project, String description, String jobArea, String remarks, User user);
	
	PurchaseRequisition read(Long id);
	PurchaseRequisition read(Long id, boolean refresh);
	
	void delete(PurchaseRequisition purchaseRequisition);
	void delete(Long id);
	
	Collection<PurchaseRequisition> list(String namedQuery, User user);
	Collection<PurchaseRequisition> list();
	
	PurchaseRequisition submit(Long id);
	
	PurchaseRequisition update(Long id, Long projectId, String description, String jobArea, String remarks, String userId);
	Collection<PurchaseRequisition> list(Status status);
	Collection<PurchaseRequisition> list(String userId, Long projectId, Status s);
	PurchaseRequisition reopen(Long id, String userId);
	PurchaseRequisition approve(Long id, String remarks, String userId);
	void updateStatusFromOrders(Long id);
	PurchaseRequisition confirm(Long id, String userId);
	
	int countItem(String userId, Long projectId, Status status);
	
	PrefixSequence updateSequence(Long id);
}
